
local thevars dolev2 welfhelpv2 falseclmv2 welffeetv2 sochelpv2 unempjobv2 dolefidlv2 whyneedv5 ////
damlivesv2 benfrsecv2 socspnd1v2 ////
welf_chavun exclusion_un indust4v2 richlawv2 wealthv2 incomgapv2 ineqrichv2 incdiffv2 ///
incdiffsv2 redistrbv2 redist2v2
polychoric `thevars'
mat polychR = r(R)
forvalues i=1/`: word count `thevars' ' {
forvalues j=1/`i' {
local setcor `setcor' `=polychR[`i',`j']'
}
if `i' < `: word count `thevars' ' local setcor `setcor' \
}
local N = _N
clear
ssd init `thevars'
ssd set obs `N'
ssd set cor `setcor'
